package com.zyh.supermark.system.domain;
/*
    用户描述类
 */
public class User {
    private int userId;
    private String userName;
    private String cardType;
    private int score;
    private String cardState;

    public User() {
    }

    public User(int userId, String userName, String cardType, int score, String cardState) {
        this.userId = userId;
        this.userName = userName;
        this.cardType = cardType;
        this.score = score;
        this.cardState = cardState;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getCardType() {
        return cardType;
    }

    public void setCardType(String cardType) {
        this.cardType = cardType;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public String getCardState() {
        return cardState;
    }

    public void setCardState(String cardState) {
        this.cardState = cardState;
    }

    @Override
    public String toString() {
        return "User{" +
                "userId=" + userId +
                ", userName='" + userName + '\'' +
                ", cardType='" + cardType + '\'' +
                ", score=" + score +
                ", cardState='" + cardState + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        User user = (User) o;

        if (userId != user.userId) return false;
        if (score != user.score) return false;
        if (userName != null ? !userName.equals(user.userName) : user.userName != null) return false;
        if (cardType != null ? !cardType.equals(user.cardType) : user.cardType != null) return false;
        return cardState != null ? cardState.equals(user.cardState) : user.cardState == null;
    }

    @Override
    public int hashCode() {
        int result = userId;
        result = 31 * result + (userName != null ? userName.hashCode() : 0);
        result = 31 * result + (cardType != null ? cardType.hashCode() : 0);
        result = 31 * result + score;
        result = 31 * result + (cardState != null ? cardState.hashCode() : 0);
        return result;
    }
}
